package com.cloud.pole.param.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 获取输入的参数,方便查找问题
 *
 * @Author: Tom
 * @Date: 2018/6/28 19:11
 * @Description:
 */
@Slf4j
@Aspect
@Component
public class ChickAop {

    @Before("execution(public * com.cloud.pole.busi.rest..*(..))")
    public void before(JoinPoint joinPoint) {
        //获取方法名
        String name = joinPoint.getSignature().getName();
        //获取参数列表
        String args = Arrays.toString(joinPoint.getArgs());

        log.info("---方法名-------------------------------------------" + name + "的参数是:" + args);
    }
}
